<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<script src="<%=request.getContextPath()%>/Scripts/jquery.thickbox.js"></script>
  <style type="text/css">
        .limitcount {
            text-overflow: ellipsis;
            overflow: hidden;
            white-space: nowrap;
            width: 100px;
        }
    </style>
<div class="col-xs-12">
	<div class="table-responsive">
		<table id="sample-table-1"
			class="table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<th class="center"><label>序号${itemcount}</label></th>
					<th class="center">姓名</th>
					<th class="center">性别</th>
					<th class="center">生日</th>		
					<th class="center">电话</th>
					<th class="center">邮箱</th>
					<th class="center">入职时间</th>
					<th class="center">状态</th>
					<th class="center">备注</th>
					<th class="center">操作</th>
				</tr>
			</thead>

			<tbody id="content">
				<c:forEach var="item" items="${employeeslist}" varStatus="status">
					<tr>
						<td class="center">${status.index+itemcount}</td>
						<td class="center">${item.name}</td>
						<td class="center" title="">${item.sex}</td>
						<td class="center"><fmt:formatDate pattern='yyyy-MM-dd HH:mm:ss' value='${item.birthday}'/></td>
						<td class="center">${item.telephone}</td>
						<td class="center" title="">${item.email}</td>
						<td class="center"><fmt:formatDate pattern='yyyy-MM-dd HH:mm:ss' value='${item.createtime}'/></td>
						<td class="center">
						<c:choose>
						  <c:when test="${item.status==0}">
						   <label class="label label-sm label-warning">默认</label>
						  </c:when>
						  <c:when test="${item.status==1}">
						  <label class="label label-danger arrowed">已收取</label>
						  </c:when>
						  <c:when test="${item.status==2}">
						  <label class="label label-warning arrowed arrowed-right">已发送 </label>
						  </c:when>
						  <c:when test="${item.status==3}">
						  <label class="label label-sm label-inverse">已删除</label>
						  </c:when>
						</c:choose>
						</td>
						<td class="center"><span class="limitcount">${item.remark}</span></td>
				
						<td class="center"><div class="visible-md visible-lg hidden-sm hidden-xs">
								<a title="删除" class="btn btn-xs btn-danger btndel" pid="${item.id}"
									pstatus="${item.status}"> <i class="icon-trash bigger-120"></i>
								</a> <a class="btn btn-xs btn-success thickbox" title="员工详情"
									href="<%=request.getContextPath()%>/employee/edit?id=${item.id}TB_iframe=true&height=400&width=750">
									<i class="icon-ok bigger-120"></i>
								</a>
							</div></td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
		<input type="hidden" name="totalPage" id="totalPage" value="${totalPage}">
	</div>
</div>
<script type="text/javascript">
	$("a.btndel").click(function() {
		if (!confirm("确定要删除吗？")) {
			return false;
		}
		var _This = $(this);
		var postid = _This.attr("pid");
		var pstatus = _This.attr("pstatus");
		$.post("<%=request.getContextPath()%>/employee/delete", {
			id : postid,
			status : pstatus
		}, function(data) {
			if (data == "OK") {
				_This.parent().parent().parent().remove();
				alert("删除成功！");
			} else {
				alert(data);
			}
		});
	});
</script>




